#include <iostream>
#include <vector>
using namespace std;

bool check(const vector<int>& a, int n, long long target) {
    int left = 0;
    long long current = 0;
    // 遍历扩展后的环形数组（2n-1长度）
    for (int right = 0; right < 2 * n - 1; ++right) {
        current += a[right % n];
        // 维护窗口：和不超过目标且长度 <=n
        while (current > target || (right - left + 1) > n) {
            current -= a[left % n];
            left++;
        }
        // 找到符合条件的子数组
        if (current == target && (right - left + 1) <= n) {
            return true;
        }
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while (T--) {
        int n;
        cin >> n;
        vector<int> a(n);
        long long sum = 0;
        for (int i = 0; i < n; ++i) {
            cin >> a[i];
            sum += a[i];
        }
        // 总和为奇数直接判定
        if (sum % 2 != 0) {
            cout << "NO\n";
            continue;
        }
        long long target = sum / 2;
        cout << (check(a, n, target) ? "YES\n" : "NO\n");
    }
    return 0;
}